<template>
	<view class="container">
		<view class="intro">
			SCHEMA: 
		</view>
		
		<view class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,index) in schema" :key="index" >
			<text class="uni-media-list" :data-schema="item.SCHEMA_NAME" @tap="toTblList">{{item.SCHEMA_NAME}}</text>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				schema: {},
			}
		},
		methods: {
			toTblList(e) {
				console.log(e.currentTarget.dataset.schema);
					uni.navigateTo({
						url: './tables?schema=' + e.currentTarget.dataset.schema
					});
			},
		},
		onLoad:function(){
			uni.request({
				url: '/api/db/getAllSchemaName',
				method: 'GET',
				data: {},
				success: res => {
					this.schema=res.data;
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
	.intro {
		font-weight: bold;
		font-size: medium;
	}
	.uni-media-list{
		margin: 0 7px;
		cursor:pointer;
		background-color: #D3D3D3;
	}
	
</style>
